<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:app="http://java.sun.com/jsf/composite/app"
                xmlns:ds="http://deltaset.org/deltaset-faces"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:fn="http://java.sun.com/jsp/jstl/functions"
                xmlns:composite="http://java.sun.com/jsf/composite">

    <ds:accordion>   
        <c:forEach items="#{desktop.menuGroups}" var="menuGroup">
            <ds:accordionTab title="#{menuGroup.title}">
                <c:if test="#{not empty menuGroup.templateSrc}">
                    <ui:include src="#{menuGroup.templateSrc}">
                        <ui:param name="menuGroup" value="#{menuGroup}"/>
                    </ui:include>
                </c:if>
                <c:if test="#{empty menuGroup.templateSrc}">
                    <c:forEach items="#{menuGroup.menuItems}" var="menuItem">                          
                        <h:commandLink  value="#{menuItem.title}">                    
                            <f:ajax render="#{contentAreaId}"
                                    listener="#{desktop.setMenuItem(menuItem)}"/>
                            <c:forEach items="#{menuItem.parameterNames}" var="parameterName">
                                <f:param name="#{parameterName}" value="#{menuItem.getParameter(parameterName)}" />                                
                            </c:forEach>
                        </h:commandLink><br/>                            
                    </c:forEach> 
                </c:if>
            </ds:accordionTab>
        </c:forEach>            
    </ds:accordion>

</ui:composition>
